package cn.sinata.wanglin.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;
import java.util.List;

import cn.sinata.wanglin.model.SameCityClass;
import cn.sinata.wanglin.village.fragment.NewsinfoListFragment;
import cn.sinata.wanglin.village.fragment.SameCityListFragment;

/**
 * description：
 * Created by kaihongwu on 2016/12/13 下午 3:32
 */
public class SameCityPagerAdapter extends FragmentStatePagerAdapter {
    private  ArrayList<SameCityClass> mdatas;
    public SameCityPagerAdapter(FragmentManager fm,  ArrayList<SameCityClass> mdatas) {
        super(fm);
        this.mdatas=mdatas;
    }

    @Override
    public Fragment getItem(int position) {
        return SameCityListFragment.newInstance(mdatas.get(position).getId());
    }

    @Override
    public int getCount() {
        return mdatas.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return mdatas.get(position).getClassify();
    }

    @Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }
}
